#!/usr/bin/env php
<?php
$dir = opendir('/tmp/22');

$files = array();
while($file = readdir($dir)){
	$files[] = $file;
}
closedir($dir);

foreach($files as $file) {
	$fileName = '/tmp/22/' . $file;
	if(is_file($fileName)){	
		$content = file_get_contents('/tmp/22/' . $file);
		$newContent = str_replace("<?php", "<?php \n\nnamespace Catalog; \n ", $content);
		file_put_contents($fileName, $newContent);
	}
		
}
